package part04_观察者模式.p02_观察者模式解决;

/**观察者：百度网站
 * @ClassName: BaiduSite
 * @Author: AllenSun
 * @Date: 2019/12/6 19:46
 */
public class BaiduSite implements Observer {
    private float temperature;
    private float pressure;
    private float humidity;

    @Override
    public void update(float temperature, float pressure, float humidity) {
        this.temperature=temperature;
        this.pressure=pressure;
        this.humidity=humidity;
        display();
    }

    public void display(){
        System.out.println("==百度网站==");
        System.out.println("****今天温度为:"+temperature+"****");
        System.out.println("****今天气压为:"+pressure+"****");
        System.out.println("****今天湿度为:"+humidity+"****");
    }
}
